package com.woniu.supermarket.mapper;

import com.woniu.supermarket.entity.SalesDetail;
import com.woniu.supermarket.vo.SalesDetailVo;
import com.woniu.supermarket.vo.totalWithId;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;
import java.util.List;

@Repository
public interface SalesDetailMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SalesDetail record);

    SalesDetail selectByPrimaryKey(Integer id);

    List<SalesDetail> selectAll();

    List<SalesDetailVo> selectAllVo(Integer id);

    int updateByPrimaryKey(SalesDetail record);

    @Update("update s_sales_detail set total = #{total} where id = #{id}")
    void updateTotalByPrimaryKey(@Param("id") Integer id,@Param("total") BigDecimal total);

    void updateTotalBatch(List<totalWithId> totalWithIdList);
}